package com.caocaog.market.applets;

import com.caocaog.market.annotation.IgnoreAuth;
import com.caocaog.market.entity.GoodsBase;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.util.RedisUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @Description
 * @Author Van.Planifolia
 * @Date 2024/1/19
 * @Version 1.0
 */
@RestController
@Api(tags = "测试接口")
@RequestMapping("/api/test")
public class TestApi {
    @Resource
    private RedisUtil redisUtil;
    @GetMapping("/a")
    @IgnoreAuth
    @ApiOperation("测试hset")
    public String testA(){
        List<GoodsBase> goodsBases = new ArrayList<>();
        goodsBases.add(new GoodsBase().setName("测试"));
        Object hget = redisUtil.hset("goodsTest", "a",goodsBases);
        System.out.println(hget);
        return "testA";
    }
}
